export function formatAvatarFromUserid(str) {
    // https://47.97.61.50:8089/avatar/o/15/10000015.jpg?r=81
    // 用户id 八位纯数字字符串 拼接头像地址
    if (typeof str !== 'string' || str.length !== 8 || /\D/.test(str)) {
        throw new Error('Input must be an eight-digit numeric string.');
    }
    //最大索引判0递减
    let startIndex = 1;
    while (startIndex < str.length && str[startIndex] === '0') {
        startIndex++;
    }
    return `https://47.97.61.50:8089/avatar/o/${str.slice(startIndex)}/${str}.jpg`
}